package yartiss.engine.simulation.system.taskset.generation;

import java.util.Map;

import yartiss.engine.simulation.system.taskset.generation.task.DefaultTaskGenerator;

public class TaskSetGenFactory {
	
	public static ITaskSetGenerator newInstance(String type, Map<String,Object> params){
		
		if("U-Uni Fast Discard Taskset Gen".equals(type)){
			int nbTask 	= Integer.parseInt(params.get("nbTask").toString());
			int nbProc	= Integer.parseInt(params.get("nbProc").toString());
			double U	= Double.parseDouble(params.get("U").toString());
			double Ue	= Double.parseDouble(params.get("Ue").toString());
			long Pr		= Long.parseLong(params.get("Pr").toString());
			long emax	= Integer.parseInt(params.get("nbTask").toString());
			int deadlineModel 	= Integer.parseInt(params.get("deadlineModel").toString());
			boolean offset 		= Boolean.parseBoolean(params.get("offset").toString());
			boolean allowEnergy	= Boolean.parseBoolean(params.get("allowEnergy").toString());
			return new UUniFastDiscardTaskSetGen(new DefaultTaskGenerator(), nbTask, nbProc, U, Ue, Pr, emax, deadlineModel, offset, allowEnergy);
		}
		else 
			throw new IllegalArgumentException("TaskSetGenFactory : "+type +" not found");
	}
	
	public static String [] availableGenerators = new String []{};

}
